﻿using System.Runtime.InteropServices;
using XLua;

namespace LuaDLL
{
    // 添加第三方库
    public partial class Lua
    {
        const string LUADLL = "xlua";

        [DllImport(LUADLL, CallingConvention = CallingConvention.Cdecl)]
        //对应pbc-lua53.c文件__declspec(dllexport) int luaopen_protobuf_c(lua_State *L)函数
        public static extern int luaopen_protobuf_c(System.IntPtr L);

        [MonoPInvokeCallback(typeof(XLua.LuaDLL.lua_CSFunction))]
        public static int LoadProtobuf(System.IntPtr L)
        {
            return luaopen_protobuf_c(L);
        }
    }
}